package test 
{
	import com.hitplane.core.BaseDisplay;
	import com.hitplane.core.Fly;
	import com.hitplane.elements.EnemyFly_A;
	import com.hitplane.elements.NormalUserFly;
	import com.hitplane.manager.CheckCollisionManager;
	import com.hitplane.manager.EnterFrameManager;
	import com.hitplane.manager.GameContainManager;
	import com.hitplane.manager.KeyBoardManager;
	import com.hitplane.manager.ObjectPoolManager;
	
	import flash.display.Sprite;
	import flash.utils.getTimer;
	
	/**
	 * @描述
	 * @作者		rrDog
	 * @版本		version 1.0
	 * @创建日期	$date
	 */
	[SWF(width="400",height="600", backgroundColor="#999999",frameRate="30")]
	public class KeyTest extends Sprite
	{
		public function KeyTest() 
		{
			initManager();
			creatFly();
			
			createEnemyFly();
			EnterFrameManager.instance.startTick();
		}
		private function initManager():void {
			GameContainManager.instance.mainStage = this.stage;
			GameContainManager.instance.setContain();
			
			EnterFrameManager.instance.addChild(KeyBoardManager.instance);
			EnterFrameManager.instance.addChild(CheckCollisionManager.instance);
			
			KeyBoardManager.instance.createTime=getTimer();
			KeyBoardManager.instance.startKey();
		}
		private function creatFly():void {
			var fly:Fly = ObjectPoolManager.instance.getObjByClass(NormalUserFly) as Fly;
			this.addChild(fly as BaseDisplay);
			fly.x = 100;
			fly.y = 500;

		}
		private function createEnemyFly():void {
			var enemyFly:Fly = ObjectPoolManager.instance.getObjByClass(EnemyFly_A) as Fly;
			this.addChild(enemyFly as BaseDisplay);
			enemyFly.x = 100;
			enemyFly.y = 50;
		}
		
	}

}